package com.yuanfeng.business.controller;

import com.yuanfeng.business.dto.ShopNavDTO;
import com.yuanfeng.business.dto.UserTokenBeanDTO;
import com.yuanfeng.commoms.dto.shop.MerchantShopNavQueryDTO;
import com.yuanfeng.commoms.util.ResponseResult;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/shop/nav")
public class ShopNavController extends BaseController {


    /**
     * 根据条件查询店铺导航栏
     * @param shopId
     * @return
     */
    @GetMapping("/selectShopNav")
    public List<MerchantShopNavQueryDTO> selectShopNav(@RequestParam("shopId") Integer shopId) {
        return shopNavService.selectShopNav(shopId);
    }
    /**
     * 店铺导航查询
     *
     * @param param
     * @return
     */
    @PostMapping("/query")
    public ResponseResult queryshopNav(@RequestBody UserTokenBeanDTO param) {

        return shopNavService.queryshopNav(param);
    }
    /**
     * 店铺导航删除
     *
     * @param param
     * @return
     */
    @PostMapping("/delete")
    public ResponseResult deleteshopNav(@RequestBody Map<String,Object> param) {
        ResponseResult result=shopNavService.deleteshopNav(param);
        return result;
    }


    /**
     * 店铺导航添加或更新
     *
     * @param param
     * @return
     */
    @PostMapping("/add")
    public ResponseResult addShopNav(@RequestBody ShopNavDTO param) {
        ResponseResult result=shopNavService.addShopNav(param);
        return result;
    }
}
